import express from 'express';
import Ret, { RetCode } from '../../bean/code/Ret';
import logger from '../../utils/logger';
const app = express();
import { urlEncode } from '../../utils';
import { db, Sequelize } from '../../dao/config';
import { converPage } from '../../bean/page';
const Store = require("../../dao/models/f_store")(db, Sequelize);

/**
 * 查询商铺设置
 */
app.get("/store/getStoreSetting", async (req, res) => {
    const storeInfo = await Store.find();
    res.json(Ret(RetCode.SUCCESS).setData(storeInfo));
})
/**
 * 更新商铺
 */
app.post("/store/sendEditStoreHandle", async (req, res) => {
    const updateRes = await Store.update(req.body,{where:{}});
    res.json(Ret(RetCode.SUCCESS).setData(updateRes));
})


export default app;
